﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Master/Site.master" AutoEventWireup="false"
    ValidateRequest="false" CodeFile="RegEntity.aspx.vb" Inherits="private_RegEntity" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h2>
        Registration - Business Entity, Organisation, Group, ...</h2>
    <p>
        If you are associated with a business, an organisation, an association, a group,
        a club or other entity please enter the details here. <em>These details are only used
            for reporting and accounting (VAT etc) purposes</em>. If you are not part of
        a business or don&#39;t own one, please use your name instead.
        <br />
        <br />
        Note: These details are checked for completeness.</p>
    <hr />
    <div>
        <table>
            <tr>
                <td valign="top">
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/i/Lighthouse_100x100.jpg" />
                </td>
                <td valign="top">
                    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
                        SelectMethod="GetData" TypeName="LogginsLogDSTableAdapters.usp_EntitySelect_ByEntityIdTableAdapter"
                        DeleteMethod="Delete" InsertMethod="Insert" UpdateMethod="Update">
                        <DeleteParameters>
                            <asp:Parameter Name="EntityID" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="Name" Type="String" />
                            <asp:Parameter Name="CompanyRegNo" Type="String" />
                            <asp:Parameter Name="DateCreated" Type="DateTime" />
                            <asp:Parameter Name="VATRegNo" Type="String" />
                            <asp:Parameter Name="EntityTypeId" Type="Int32" />
                            <asp:Parameter Name="Active" Type="Boolean" />
                            <asp:Parameter Direction="InputOutput" Name="EntityId" Type="Object" />
                        </InsertParameters>
                        <SelectParameters>
                            <asp:Parameter Name="EntityID" Type="Int32" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="Name" Type="String" />
                            <asp:Parameter Name="CompanyRegNo" Type="String" />
                            <asp:Parameter Name="DateCreated" Type="DateTime" />
                            <asp:Parameter Name="VATRegNo" Type="String" />
                            <asp:Parameter Name="EntityTypeId" Type="Int32" />
                            <asp:Parameter Name="Active" Type="Boolean" />
                            <asp:Parameter Name="Original_ID" Type="Int32" />
                        </UpdateParameters>
                    </asp:ObjectDataSource>
                    <asp:FormView ID="FormView1" runat="server" DataKeyNames="ID" DataSourceID="ObjectDataSource1"
                        DefaultMode="Edit">
                        <EditItemTemplate>
                            <table style="width: 100%;">
                                <tr>
                                    <td>
                                        Business Name:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
                                        <asp:BalloonPopupExtender ID="BalloonPopupExtender_txtEntityName" runat="server"
                                            CustomCssUrl="" DynamicServicePath="" Enabled="True" ExtenderControlID="" BalloonPopupControlID="Panel_Entity"
                                            DisplayOnFocus="true" UseShadow="true" Position="Auto" BalloonStyle="Cloud" BalloonSize="Medium"
                                            TargetControlID="NameTextBox">
                                        </asp:BalloonPopupExtender>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Company Reg No:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="CompanyRegNoTextBox" runat="server" Text='<%# Bind("CompanyRegNo") %>' />
                                        <asp:MaskedEditExtender ID="CompanyRegNoTextBox_MaskedEditExtender" runat="server"
                                            TargetControlID="CompanyRegNoTextBox" Mask="9999999" MessageValidatorTip="true"
                                            OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" ErrorTooltipEnabled="True"
                                            Enabled="True">
                                        </asp:MaskedEditExtender>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        VAT Reg No:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="VATRegNoTextBox" runat="server" Text='<%# Bind("VATRegNo") %>' />
                                        <asp:MaskedEditExtender ID="VATRegNoTextBox_MaskedEditExtender" runat="server" TargetControlID="VATRegNoTextBox"
                                            Mask="GB999999999" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                                            OnInvalidCssClass="MaskedEditError" ErrorTooltipEnabled="True" Enabled="True"
                                            MaskType="Number">
                                        </asp:MaskedEditExtender>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Type of Business:
                                    </td>
                                    <td>
                                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                            <ContentTemplate>
                                                <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="ddlEntityTypeODS"
                                                    DataTextField="Name" DataValueField="Id" AppendDataBoundItems="True" SelectedValue='<%# Bind("EntityTypeId") %>'>
                                                    <asp:ListItem Value="0">Pick one please...</asp:ListItem>
                                                </asp:DropDownList>
                                                <asp:ObjectDataSource ID="ddlEntityTypeODS" runat="server" DeleteMethod="Delete"
                                                    InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
                                                    TypeName="LogginsLogDSTableAdapters.usp_lkp_EntityTypeSelectTableAdapter" UpdateMethod="Update">
                                                    <DeleteParameters>
                                                        <asp:Parameter Name="Id" Type="Int32" />
                                                    </DeleteParameters>
                                                    <InsertParameters>
                                                        <asp:Parameter Name="Name" Type="String" />
                                                        <asp:Parameter Name="Active" Type="Boolean" />
                                                    </InsertParameters>
                                                    <SelectParameters>
                                                        <asp:Parameter DefaultValue="" Name="Id" Type="Int32" />
                                                    </SelectParameters>
                                                    <UpdateParameters>
                                                        <asp:Parameter Name="Id" Type="Int32" />
                                                        <asp:Parameter Name="Name" Type="String" />
                                                        <asp:Parameter Name="Active" Type="Boolean" />
                                                    </UpdateParameters>
                                                </asp:ObjectDataSource>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </td>
                                </tr>
                            </table>
                            <asp:Panel ID="Panel_Entity" runat="server" Visible="true">
                                <b>What is this? Enter the name of a Business, a Club, a Group, an Organisation (you
                                    may use your name if this makes sense) or other thing that you represent, own or control.</b>
                            </asp:Panel>
                            <asp:Button ID="UpdateButton1" runat="server" CausesValidation="True" CommandName="Update"
                                Text="Submit" />
                            <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' Style="visibility: hidden;" />
                            <br />
                            &nbsp;<asp:TextBox ID="DateCreatedTextBox" runat="server" Text='<%# Bind("DateCreated") %>'
                                Style="visibility: hidden;" />
                            <br />
                            &nbsp;<asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%# Bind("Active") %>'
                                Style="visibility: hidden;" />
                            <br />
                            <%--                            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                            --%>
                            <br />
                            <br />
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            Name:
                            <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
                            <br />
                            Company Reg No:
                            <asp:TextBox ID="CompanyRegNoTextBox" runat="server" Text='<%# Bind("CompanyRegNo") %>' />
                            <br />
                            Date Created:
                            <asp:TextBox ID="DateCreatedTextBox" runat="server" Text='<%# Bind("DateCreated") %>' />
                            <br />
                            VAT Reg No:
                            <asp:TextBox ID="VATRegNoTextBox" runat="server" Text='<%# Bind("VATRegNo") %>' />
                            <br />
                            Entity Type:
                            <asp:TextBox ID="EntityTypeIdTextBox" runat="server" Text='<%# Bind("EntityTypeId") %>' />
                            <br />
                            Active:
                            <asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%# Bind("Active") %>' />
                            <br />
                            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                                Text="Insert" />
                            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                                CommandName="Cancel" Text="Cancel" />
                        </InsertItemTemplate>
                        <ItemTemplate>
                            ID:
                            <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                            <br />
                            Name:
                            <asp:Label ID="NameLabel" runat="server" Text='<%# Bind("Name") %>' />
                            <br />
                            Company Reg No:
                            <asp:Label ID="CompanyRegNoLabel" runat="server" Text='<%# Bind("CompanyRegNo") %>' />
                            <br />
                            DateCreated:
                            <asp:Label ID="DateCreatedLabel" runat="server" Text='<%# Bind("DateCreated") %>' />
                            <br />
                            VAT Reg No:
                            <asp:Label ID="VATRegNoLabel" runat="server" Text='<%# Bind("VATRegNo") %>' />
                            <br />
                            Entity Type:
                            <asp:Label ID="EntityTypeIdLabel" runat="server" Text='<%# Bind("EntityTypeId") %>' />
                            <br />
                            Active:
                            <asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%# Bind("Active") %>'
                                Enabled="false" />
                            <br />
                            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                                Text="Edit" />
                            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"
                                Text="Delete" />
                            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New"
                                Text="New" />
                        </ItemTemplate>
                    </asp:FormView>
                    <br />
                </td>
            </tr>
        </table>
    </div>
    <div>
    </div>
    <asp:Panel ID="pnlDisabledByAdmin" runat="server" Style="display: none" CssClass="modalPopup">
        <%--    <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup">--%>
        <asp:Button ID="btnCancelInvitationFail" runat="server" Text="X" Style="float: right;
            background-color: #FF0000;" />
        <h2>
        </h2>
        <table>
            <tr>
                <td>
                    Name *
                </td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" Text="" />
                </td>
                <td>
                    <asp:Label ID="lblName" runat="server" Text="A Name is Required" Visible="false"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    Company Reg No *
                </td>
                <td>
                    <asp:TextBox ID="txtCompanyRegNo" runat="server" Text="" />
                </td>
                <td>
                    <asp:Label ID="lblCompanyRegNo" runat="server" Text="A CompanyRegNo is Required"
                        Visible="false"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    VAT Reg No.
                </td>
                <td>
                    <asp:TextBox ID="txtVATRegNo" runat="server" />
                </td>
                <td>
                    <asp:Label ID="lblVATRegNo" runat="server" Text="A VATRegNo is Required" Visible="false"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnInsert" runat="server" CausesValidation="True" Text="Insert" />
                    <asp:Button ID="btnUpdate" runat="server" CausesValidation="True" Text="Update" />
                </td>
                <td>
                </td>
            </tr>
        </table>
        <p>
        </p>
    </asp:Panel>
    <asp:Button ID="btnDisabledByAdmin" runat="server" Text="Button" Style="display: none;" />
    <asp:ModalPopupExtender ID="DisabledByAdminModalPopupExtender1" runat="server" PopupControlID="pnlDisabledByAdmin"
        DynamicServicePath="" Enabled="True" TargetControlID="btnDisabledByAdmin" BackgroundCssClass="modalBackground"
        DropShadow="true">
    </asp:ModalPopupExtender>
</asp:Content>
